{% extends "base_sub.html" %}

{% block title %}登录{% endblock title %}

{% block content %}
<div id="mb_login" class="mbskin">
    <div class="mbskin_box">
        <h1>登录</h1>
        <div class="mb_log_cate">
            <h2><span class="blind">成员</span>登录</h2>
            <a href="/bbs/register" class="join">成员资格</a>
        </div>
        <form name="flogin" action="/bbs/login" onsubmit="return flogin_submit(this);" method="post">
            <input type="hidden" name="url" value="{{ url }}">
            <fieldset id="login_fs">
                <legend>会员登录</legend>
                <label for="login_id" class="blind">会员Id<strong class="blind"> 必不可少的</strong></label>
                <input type="text" name="mb_id" id="login_id" required value="{{ mb_id }}" class="frm_input required alnum_" size="20" maxLength="20" placeholder="Idie">
                <label for="login_pw" class="blind">密码<strong class="blind"> 必不可少的</strong></label>
                <input type="password" name="mb_password" id="login_pw" required class="frm_input required" size="20" maxLength="20" placeholder="密码">
                <button type="submit" class="btn_submit">登录</button>

                <div id="login_info">
                    <div class="login_if_auto chk_box">
                        <input type="checkbox" name="auto_login" id="login_auto_login">
                        <label for="login_auto_login"><span></span> 自动登录</label>  
                    </div>
                    <div class="login_if_lpl">
                        <a href="/bbs/id_lost">找到你的ID</a> |
                        <a href="/bbs/password_lost">找到您的密码</a>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    {% include "social/social_login.html" %}
</div>

<script>
    jQuery(function($){
        $("#login_auto_login").click(function(){
            if (this.checked) {
                this.checked = confirm("如果您使用自动登录，则无需从以下位置输入会员的姓名和密码:.\n\n请不要在公共场所使用个人信息。.\n\n是否使用自动登录?");
            }
        });
    });

    function flogin_submit(f)
    {
        if( $( document.body ).triggerHandler( 'login_sumit', [f, 'flogin'] ) !== false ){
            return true;
        }
        return false;
    }

</script>
{% endblock content %}